package model;
import java.util.*;
public class Course {
	List<Student> stuList = new ArrayList<>();
	private String name;
	private double grade = 0;
	 public int leftNumber = 30;
	

	private Teacher teacher;
	
	@Override
	public String toString() {
		return "Course [name=" + name + ", grade=" + grade + ", teacher=" + teacher.toString() + "]";
	}
	public Teacher getTeacher() {
		return teacher;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	public Course(String name,Teacher teacher) {
		this.name = name;
		this.teacher = teacher;
	}
	public Course(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getGrade() {
		return grade;
	}
	public void setGrade(double grade) {
		this.grade = grade;
	}
	public int getLeftNumber() {
		return leftNumber;
	}
	public void setLeftNumber(int leftNumber) {
		this.leftNumber = leftNumber;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Course other = (Course) obj;
		if (Double.doubleToLongBits(grade) != Double.doubleToLongBits(other.grade))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (teacher == null) {
			if (other.teacher != null)
				return false;
		} else if (!teacher.equals(other.teacher))
			return false;
		return true;
	}
	
	
}
